#!/bin/bash
cd /root
ls Python-3.9.2.tgz || wget https://repo.huaweicloud.com/python/3.9.2/Python-3.9.2.tgz --no-check-certificate
tar -xvf Python-3.9.2.tgz
cd Python-3.9.2
./configure --prefix=/usr/local/python3.9.2 --enable-loadable-sqlite-extensions --enable-shared --with-openssl=/usr/local/openssl11/
make -j120
make install


cat <<EOF >/usr/local/ascendrc_python3.9.2
export PATH=/usr/local/python3.9.2/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/python3.9.2/lib:$LD_LIBRARY_PATH
EOF
source /usr/local/ascendrc_python3.9.2
/usr/local/python3.9.2/bin/python3.9 -m pip install --upgrade pip
python3 --version
pip3 show pip
